QL4QL: Exclude PrintAst like tests from being reported as having missing InlineExpectations.#19104
Conversation
… query with a PrintAst name from QlRefInlineExpectations.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (8)
- ql/ql/src/codeql_ql/ast/Yaml.qll: Language not supported
- ql/ql/src/queries/style/QlRefInlineExpectations.ql: Language not supported
- ql/ql/test/queries/style/QlRefInlineExpectations/PrintAst.expected: Language not supported
- ql/ql/test/queries/style/QlRefInlineExpectations/PrintAst.qlref: Language not supported
- ql/ql/test/queries/style/QlRefInlineExpectations/Test4.expected: Language not supported
- ql/ql/test/queries/style/QlRefInlineExpectations/Test4.qlref: Language not supported
- ql/ql/test/queries/style/QlRefInlineExpectations/dummy/PrintAst.expected: Language not supported
- ql/ql/test/queries/style/QlRefInlineExpectations/dummy/PrintAst.ql: Language not supported
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
| exists(YamlMapping n, YamlScalar value | | ||
| n.getDocument() = this and | ||
| value.getValue().matches("%PrintAst%") | ||
| | | ||
| value = n.lookup("query") | ||
| ) |
There was a problem hiding this comment.
Maybe add a comment that this is for .qlref files.
And maybe check that the file-extension is .qlref?
There was a problem hiding this comment.
Thanks for the review! That is included in the char pred and description of the class QlRefDocument. Is that acceptable?
However, I do need to add a comment for the predicate.
There was a problem hiding this comment.
Oh, I didn't notice that context.
LGTM 👍
| ) | ||
| } | ||
|
|
||
| predicate isPrintAst() { |
There was a problem hiding this comment.
A more ambitious solution would be to resolve the the query pointed to by the .qlref file, and then only flag cases where the query has kind problem or path-problem, but we can leave that for a future improvement.
No description provided.